#ifndef THREADS_H_
#define THREADS_H_

using namespace std;

#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#define ATTACH true
#define DEATTACH false

class Thread {
protected:
	pthread_t threadid;
	pthread_attr_t attr;
	void *dato;
	bool running;

	static void* runThread(void* thread);

public:
	Thread(bool atributo);//En caso de ser TRUE el atributo, el thread sera attachado.
	virtual void run()=0;
	int start();
	int join();
	bool get_running();
	void set_running(bool running);
	void set_dato(void * dato);
	void* get_dato();
	pthread_t get_id();
};

#endif /* THREADS_H_ */
